﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Brjnk.GpxExplorer.UI.Controls
{
    public class HighlightedTextBlock : Control
    {
        static HighlightedTextBlock()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(HighlightedTextBlock), new FrameworkPropertyMetadata(typeof(HighlightedTextBlock)));
            BackgroundProperty.OverrideMetadata(typeof(HighlightedTextBlock), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.LightSalmon)));
        }

        public double CornerRadius
        {
            get { return (double)GetValue(CornerRadiusProperty); }
            set { SetValue(CornerRadiusProperty, value); }
        }

        public static readonly DependencyProperty CornerRadiusProperty =
            DependencyProperty.Register("CornerRadius", typeof(double), typeof(HighlightedTextBlock), new UIPropertyMetadata(4.0));

        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }

        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(HighlightedTextBlock), new UIPropertyMetadata());
    }
}